package com.chao.product.exception.handler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.chao.model.PmsProduct;
import com.model.CommonResult;

import java.util.ArrayList;
import java.util.List;

public class SystemBlockHandlerException {

    //返回值类型和参数类型得一样.
    public static CommonResult testHelloBlockHandler(Long s, BlockException ex) {
        ex.printStackTrace();
        return CommonResult.failed(String.format("testHelloBlockHandler and %d", s));
    }

    public static List<PmsProduct> testHelloBlockHandlerService(BlockException ex) {
        ex.printStackTrace();
        //这里是service 返回给controller的值 必须和service的返回值类型一样.
        return new ArrayList<PmsProduct>();
    }
}
